<style type="text/css">
#allmap{height:300px;width:100%;}
.storelogo img{width:3.2rem;height:3.2rem}
.merchgroup .store-star {padding:0.1rem 0 0.2rem 0;font-size:0.55rem;line-height:1rem}
.merchgroup .store-star img{height:0.66rem}
.star-on,.star-off{position:absolute;top:1rem;left:0;overflow:hidden}
.star-rate {margin-left:0.2rem;color:#19b955}
.store-distance{float:right;color:#999}
.store-moneylimit{font-size:0.55rem}
.delete{color: #bebebe;text-decoration:line-through;font-size:0.55rem}
</style>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=g0EGHiZVlG52nvXSmZsozaQVERtS9dPh"></script>
<div class="fui-page order-create-page fui-page-current" ng-if="pagedata.op == 'list'">
	<div class="fui-content">
		<div id="allmap"></div>
		<div class="fui-list-group merchgroup" ng-repeat="item in pagedata.list">
            <div class="fui-list">
               <a class="fui-list-inner" style="margin-top:0.16rem" href="javascript:;" ng-click="access_json('jy_meifa/store/detail/id='+item.id)">
                    <div class="title" style="font-size:0.8rem"><span>{{item.title}}</span></div>
                    <div class="subtitle" style="font-size:0.65rem;color:#333"><span class="">洗剪吹￥{{item.price || '0.00'}}</span><span class="delete">￥{{item.yprice || '0.00'}}</span></div>
					<div class="subtitle" style="line-height:1.3rem"><span class="label jylabel-default">{{item.num2}}人正在剪发</span></div>
					<div class="subtitle">
						<span style="font-size:0.55rem;line-height:0.75rem"><i class="icon jinyunicon icon-ditu"></i> {{item.address}}</span>
						<span style="font-size:0.55rem;line-height:0.75rem"> 距您{{item.juli}}公里</span>
						<span class="label label-danger r-f" style="font-size:0.65rem;padding:5px">去剪发</span>
					</div>
                </a>
            </div>
		</div>
		<div ng-show="loading" class='infinite-loading'><span class='fui-preloader'></span><span style="margin-left:1.5rem"> 正在加载...</span></div>
	</div>
<script type="text/javascript">
// 百度地图API功能
require(['map'], function(BMap){
	var map = new BMap.Map("allmap");
	var first=scope.pagedata.list['0'];
	var list=scope.pagedata.list;
	var post=scope.pagedata.post;
	if(first){
	var point = new BMap.Point(first['lat_lng']['lng'], first['lat_lng']['lat']);
	}else{
	var point = new BMap.Point(post['lng'], post['lat']);
	}
	map.centerAndZoom(point, 15);
	// 编写自定义函数,创建标注
	function addMarker(point){
	  var marker = new BMap.Marker(point);
	  map.addOverlay(marker);
	}
	for (var i = 0; i < list.length; i ++) {
		var point = new BMap.Point(list[i]['lat_lng']['lng'], list[i]['lat_lng']['lat']);
		addMarker(point);
	}
});
</script>
</div>
<div ng-include="sys_html('_footer')"></div>
<script>
	scope.loading = true;
	    // 百度地图API功能
	window.scope.location(function(re){
	
	var data={
	'data':re.lat_lng,
	'op':'list',
	};
	data.callback=function(d){
	
		window.scope.pagedata.list=d.list;
		scope.loading = false;
		scope.$apply();
	}
	//alert(JSON.stringify(data));
	window.scope.post_json(data);
	
	});
	require(['bootstrap', 'hammer'], function($, Hammer){
		$('#carousel-container').carousel();
		var mc = new Hammer($('#carousel-container').get(0));
		mc.on("panleft", function(ev) {
			$('#carousel-container').carousel('next');
		});
		mc.on("panright", function(ev) {
			$('#carousel-container').carousel('prev');
		});
	});
</script>

